dicts = {'POST': 0, 'GET': 0}
def initial():
    dicts['POST'] = 0
    dicts['GET'] = 0

def statistics():
    pro_flag = True
    while pro_flag:
        logs = input("请输入统计日志:")
        log_lines = logs.split('\n')
        for line in log_lines:
            if line == '':
                continue
            else:
                col2_content = line.split(' ')[1]
                if col2_content.lower().strip('"') == 'post':
                    dicts['POST'] += 1
                elif col2_content.lower().strip('"') == 'get':
                    dicts['GET'] += 1
        print('POST请求次数: {}'.format(dicts['POST']))
        print('GET请求次数: {}'.format(dicts['GET']))
        initial()
        flag = input("输入(Q/q)键选择退出程序: ")
        if flag.lower() == 'q':
            pro_flag = False
        else:
            continue
statistics()